package 正则表达式;

public class Reg11 {
    public static void main(String[] args) {
        String s="java";
        int a=s.split("java").length>0?s.split("java").length-1:0;
        if(s.endsWith("java")){
            a+=1;

        }
        System.out.println(a);
    }
}
